package com.dk.hi.core;

import java.util.HashMap;
import java.util.Map;

/**
 * Switch Manager. Handles all game switches.
 */
public abstract class SwitchManager {
	/**
	 * The defined switches
	 */
	private static Map<Integer, Boolean> switches = new HashMap<Integer, Boolean>();

	/**
	 * Disable the switch
	 * 
	 * @param id
	 *            - the switche's id
	 */
	public static void disable(Integer id) {
		switches.put(id, false);
	}

	/**
	 * Enable the switch
	 * 
	 * @param id
	 *            - the switche's id
	 */
	public static void enable(Integer id) {
		switches.put(id, true);
	}

	/**
	 * @param id
	 *            - the switche's id
	 * @return the switche's state : on = true, off = false. If the switch is not defined, false
	 *         will be returned
	 */
	public static boolean getStateOf(Integer id) {
		return switches.get(id) == null ? false : switches.get(id);
	}
}
